Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Justin Zenfoostergon 14.May.03 11:44 PM a Web browser
Notes Client 6.0.1 Windows 2000


I have a view full of about 40 documents. I want to loop through them an open/edit/save each one so that a QuerySave action happens that does a bunch of other stuff.

I built the following code which generates an error that I believe is caused by the line
Call UserUIDocument.Close

If I REM out that line everything works but I end up with all the documents open.

The error is "Error 4429: Unable to defer document close"

any ideas?

==========================================
Sub Initialize
Dim Session As New NotesSession
Dim DB As NotesDatabase
Dim NoteCollection As NotesDocumentCollection
Dim UserUIDocument As NotesUIDocument
Dim UserUIWorkspace As New NotesUIWorkspace

Dim dateTime As New NotesDateTime( "12/01/94" )
Dim NoteDoc As NotesDocument

On Error Goto HandleErr

Set DB = Session.CurrentDatabase
searchFormula$ = "Form = ""Category"""
Set NoteCollection = DB.Search( searchFormula$, dateTime, 0)

Set NoteDoc = NoteCollection.GetFirstDocument

For i = 1 To NoteCollection.Count
Set UserUIDocument = UserUIWorkspace.EditDocument( True, NoteDoc)
Call UserUIDocument.Save
Call UserUIDocument.Close
Set NoteDoc = NoteCollection.GetNextDocument(NoteDoc)
Next

Msgbox "This agent has worked with " & NoteCollection.Count & " Notes." & Error, 0 + 48, "System Message"

Exit Sub

' Error Handling
HandleErr:

Msgbox "Unknown error:" & Chr(10) & Chr(10) & "Error Num: " & Err() & Chr(10) & "Description: " & Error, 0 + 48, "System Message"

Exit Sub ' Exit when error occurs
End Sub






Agent to update docs in a view (~Justin Zenfoos... 14.May.03)
. . Solved: Agent to update docs in a v... (~Justin Zenfoos... 16.May.03)
. . . . RE: Solved: Agent to update docs in... (~Delores Dwonic... 16.May.03)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS